PICTools Programmer's Reference
Image Detergent

Removes noise in given colors in 24-bit images.  Image detergent uses parameters similar to the color dropout function, but rather than dropping al selected colors to a single given color, each color region is dropped to its center point. 

Figure 2  An Image Detergent operation on pink flattens the background color, removing much of the noise there.  Settings shown, color 254, 202, 226, radius 50.

 Image Detergent works like color dropout, where colors within radius/2 drop completely to the center point, and colors between radius/2 and radius are dropped proportionally less with increasing distance.  Any number of colors may be dropped at one time, with no performance penalty, but care should be taken that none of the color regions overlap, as this can cause unexpected behavior in the intersection of the regions.

Since variance is common in scanned images, it is possible to specify that a given color is to be adapted on an image-by-image basis.  For example, if dropping white (255, 255, 255) then setting SCANFIX_COLOR_ADAPT will tell the algorithm to analyze the image, and change the value of the color up to 1/2 the radius in any direction to match the nearest peak RGB value.  This is most useful when a small radius is specified.  Use of this adaptive feature is slower, however, as it requires analysis of each individual image before processing to find the appropriate peak.  A larger radius, if it can safely be used, will provide better performance.

Image Detergent also allows an automatic mode, which attempts to find local maximums in the colorspace histogram of the image, and set drop points at those maximums.  Due to the inherent complexity of a three dimensional colorspace, this method is best used on simple images that use solid colors, rather than images with gradients and photographic backgrounds.

Specifying a color count of zero causes the algorithm to use special case color drop patterns.  In manual mode, a value of zero sets up a large radius region at white, and smaller radius regions at black and the primary and secondary colors.  This should be useful for document images with simple color graphics using a number of different colors.  In automatic mode, a color count of zero sets a large radius region at white, and a small radius region at black and one fully bright, saturated color.  This color is chosen based on the peak hue of the image.  This should be useful for forms printed with a single color of ink on white paper.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback